<template>
	<view>
		<view class="boxContrainer">
			<view class="titlBox">
				<text class="title">基础信息</text>
			</view>
			<view class="contentBox">
				<view class="textItem">
					<text>订单号</text>
					<text style="color: #333;">{{detailInfo.orderNo|filterNull}}</text>
				</view>
				<view class="textItem">
					<text>所属门店</text>
					<text style="color: #333;">{{detailInfo.storeName|filterNull}}</text>
				</view>
				<view class="textItem">
					<text>申请费用</text>
					<text style="color: #333;">¥{{detailInfo.amount|filterNull}}</text>
				</view>
				<view class="textItem">
					<text>状态</text>
					<text style="color: #333;">{{detailInfo.status|receiptStatus}}</text>
				</view>
				<view class="textItem">
					<text>车型信息</text>
					<text style="color: #333;">{{detailInfo.modelName| filterNull}}</text>
				</view>

				<view class="textItem">
					<text style="margin-right: 30rpx;">租赁时间</text>
					<text style="color: #333; flex:1">{{detailInfo.time|filterNull}}</text>
				</view>
				<view class="textItem">
					<text>费用类型</text>
					<text style="color: #333;">{{detailInfo.receiptBillTypeName|filterNull}}</text>
				</view>
				<view class="textItem">
					<text>申请人</text>
					<text style="color: #333;">{{detailInfo.applyUserName|filterNull}}</text>
				</view>
				<view class="textItem">
					<text>申请时间</text>
					<text style="color: #333;">{{detailInfo.applyTime|filterNull}}</text>
				</view>
				<view class="textItem" style="flex-direction: column;align-items: flex-start;">
					<text style="margin-bottom: 16rpx;">支付凭证</text>
					<view class="flex-row-center-sb" v-if="applyUrl.length>0">
						<view style="margin-right: 30rpx;">
							<u-album  :urls="applyUrl" singleSize="158">
							</u-album>
						</view>
					</view>
				</view>
				<view class="textItem">
					<text>申请备注</text>
					<text style="color: #333;">{{detailInfo.applyNote | filterNull}}</text>
				</view>


			</view>
		</view>

		<view class="boxContrainer" v-if="detailInfo.status>1">
			<view class="titlBox">
				<text class="title">会计审核</text>
			</view>
			<view class="contentBox">
				<view class="textItem">
					<text>会计审核人</text>
					<text style="color: #333;">{{detailInfo.accountingReviewer|filterNull}}</text>
				</view>
				<view class="textItem">
					<text>审核时间</text>
					<text style="color: #333;">{{detailInfo.accountingReviewerTime|filterNull}}</text>
				</view>
				<view class="textItem" style="flex-direction: column;align-items: flex-start;">
					<text style="margin-bottom: 16rpx;">审核附件</text>

					<view class="flex-row-center-sb" v-if="accountingUrl.length>0">
						<view style="margin-right: 30rpx;">
							<u-album  :urls="accountingUrl" singleSize="158">
							</u-album>
						</view>
					</view>
				</view>
				<view class="textItem">
					<text>备注</text>
					<text style="color: #333;">{{detailInfo.accountingReviewerNote|filterNull}}</text>
				</view>
			</view>
		</view>

		<view class="boxContrainer" v-if="detailInfo.status>3">
			<view class="titlBox">
				<text class="title">经理审核</text>
			</view>
			<view class="contentBox">
				<view class="textItem">
					<text>经理审核人</text>
					<text style="color: #333;">{{detailInfo.managerAuditor|filterNull}}</text>
				</view>
				<view class="textItem">
					<text>审核时间</text>
					<text style="color: #333;">{{detailInfo.managerAuditorTime|filterNull}}</text>
				</view>
				<view class="textItem" style="flex-direction: column;align-items: flex-start;">
					<text style="margin-bottom: 16rpx;">审核附件</text>
					<view class="flex-row-center-sb" v-if="managerUrl.length>0">
						<view style="margin-right: 30rpx;">
							<u-album  :urls="managerUrl" singleSize="158">
							</u-album>
						</view>
					</view>
				</view>
				<view class="textItem">
					<text>备注</text>
					<text style="color: #333;">{{detailInfo.managerAuditorNote|filterNull}}</text>
				</view>
			</view>
		</view>

		<view class="boxContrainer" v-if="detailInfo.status>5">
			<view class="titlBox">
				<text class="title">出纳审核</text>
			</view>
			<view class="contentBox">
				<view class="textItem">
					<text>出纳审核人</text>
					<text style="color: #333;">{{detailInfo.cashierAuditor|filterNull}}</text>
				</view>
				<view class="textItem">
					<text>审核时间</text>
					<text style="color: #333;">{{detailInfo.cashierAuditorTime|filterNull}}</text>
				</view>
				<view class="textItem">
					<text>交易单号</text>
					<text style="color: #333;">{{detailInfo.transactionNo|filterNull}}</text>
				</view>
				<view class="textItem" style="flex-direction: column;align-items: flex-start;">
					<text style="margin-bottom: 16rpx;">审核附件</text>
					<view class="flex-row-center-sb"  v-if="cashierUrl.length>0">
						<view style="margin-right: 30rpx;">
							<u-album :urls="cashierUrl" singleSize="158">
							</u-album>
						</view>
					</view>
				</view>
				<view class="textItem">
					<text>备注</text>
					<text style="color: #333;">{{detailInfo.cashierAuditorNote|filterNull}}</text>
				</view>
			</view>
		</view>


	</view>
</template>

<script>
	import * as paymentApplyApi from '@/api/paymentApply-api.js';
	import settings from '@/settings.js'
	export default {
		data() {
			return {
				id: null,
				detailInfo: {},
				applyUrl: [],
				accountingUrl: [],
				managerUrl: [],
				cashierUrl: []

			}
		},
		onLoad(op) {
			this.id = op.id;
			this.getDetail();
		},
		methods: {
			getDetail() {
				paymentApplyApi.billDetail(this.id).then(res => {
					this.detailInfo = res.data;
					if (!this.$u.test.isEmpty(this.detailInfo.applyUrl)) {
						const urls = this.detailInfo?.applyUrl?.split(',');
						this.applyUrl = urls?.map(urlPath => {
							return settings.baseImageUrl + urlPath;
						})
					}
					if (!this.$u.test.isEmpty(this.detailInfo.accountingUrl)) {
						const urls = this.detailInfo?.accountingUrl?.split(',');
						this.accountingUrl = urls?.map(urlPath => {
							return settings.baseImageUrl + urlPath;
						})
					}
					if (!this.$u.test.isEmpty(this.detailInfo.managerUrl)) {
						const urls = this.detailInfo?.managerUrl?.split(',');
						this.managerUrl = urls?.map(urlPath => {
							return settings.baseImageUrl + urlPath;
						})
					}
					if (!this.$u.test.isEmpty(this.detailInfo.cashierUrl)) {
						const urls = this.detailInfo?.cashierUrl?.split(',');
						this.cashierUrl = urls?.map(urlPath => {
							return settings.baseImageUrl + urlPath;
						})
					}
				})
			}
		}
	}
</script>

<style lang="scss" scoped>

</style>